﻿<Window x:Class="SoftTeach.View.Personen.GruppenErstellenDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:SoftTeach.Resources.Controls"
        Title="Frage ..." 
        Height="531" 
        Width="546">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <controls:SmallDialogHeader Grid.Row="0" Title="Wie sollen die Gruppen eingeteilt werden?"
                                      Icon="/SoftTeach;component/Images/Schülerliste32.png"/>

    <Grid Grid.Row="1" Background="{x:Static SystemColors.MenuBarBrush}">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Label Grid.Column="0" Grid.Row="0" Content="Anzahl der Schüler pro Gruppe" VerticalAlignment="Center"/>
      <controls:NumericUpDown Grid.Column="1" Grid.Row="0" TabIndex="1" HorizontalAlignment="Left"
                              Style="{StaticResource NumericUpDownRoundStyle}"
                              Value="{Binding Path=Gruppenmitgliederanzahl, Mode=TwoWay}"
                              Minimum="1"
                              Maximum="50"
                              DecimalPlaces="0" 
                              Change="1"/>
      <ToolBar Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2">
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
                    Command="{Binding Path=GruppenNeuEinteilenCommand}" 
                    ToolTip="Gruppen neu einteilen.">
          <Image Source="/SoftTeach;component/Images/Würfel16.png"/>
        </Button>
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
                    Command="{Binding Path=GruppenAusdruckenCommand}" 
                    ToolTip="Gruppen neu einteilen.">
          <Image Source="/SoftTeach;component/Images/Printer16.png"/>
        </Button>
      </ToolBar>
      <ListBox Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"
                 ItemsSource="{Binding Path=GruppenView}"             
                 BorderThickness="0"
                 Name="GruppenListBox"
                 ItemTemplate="{StaticResource SchülerlisteGruppenView}"
                 ItemContainerStyle="{StaticResource UnselectableListBoxItem}">
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <WrapPanel Width="{Binding ElementName=GruppenListBox, Path=ActualWidth, Converter={StaticResource WrapPanelWidthConverter}}"/>
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
        <!--<ListBox.GroupStyle>
          <GroupStyle ContainerStyle="{StaticResource GruppenHeaderStyle}">
            <GroupStyle.Panel>
              <ItemsPanelTemplate>
                <StackPanel/>
              </ItemsPanelTemplate>
            </GroupStyle.Panel>
          </GroupStyle>
        </ListBox.GroupStyle>-->
      </ListBox>
    </Grid>
    <Grid Background="{StaticResource DefaultButtonsBackgroundBrush}" Grid.Row="2">
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
        <Button Width="100" IsDefault="True" Click="OkClick" TabIndex="2">OK</Button>
        <Button Width="100" IsCancel="True" Click="CancelClick" TabIndex="2" Margin="10,0,0,0">Abbruch</Button>
      </StackPanel>
    </Grid>
  </Grid>
</Window>
